package main

import "fmt"

//指向函数的指针, 变量为函数
func andBodySay(f func(word string)) {
	f("hello")
}

func main() {
	var ff func(word string)

	var f1 = func(word string) {
		fmt.Println(word, " f1")
	}

	ff = f1
	fmt.Println(ff)
	ff("heihei")

	andBodySay(f1)

	var f2 = func(word string) {
		fmt.Println(word, " f2")
	}
	andBodySay(f2)

	f3 := f2
	andBodySay(f3)
}
